package com.hsogoo.study.spring.propertysource;

import java.util.Map;

import org.junit.Test;
import org.springframework.core.env.SystemEnvironmentPropertySource;

/**
 * Created by za-huangsaigang on 2018/9/17.
 */
public class SystemEnvironmentPropertySourceTest {

    @Test
    public void testSystemEnvironmentPropertySource(){
        SystemEnvironmentPropertySource source =
                new SystemEnvironmentPropertySource("systemEnvironment",(Map)System.getenv());
        System.out.println(source.getProperty("PROCESSOR_LEVEL"));
        System.out.println(source.getProperty("PROCESSOR_LEVEL".toLowerCase()));
        System.out.println(source.getProperty("PROCESSOR.LEVEL"));
        for(String s : source.getPropertyNames()){
            System.out.println("sys.env:" + s);
        }
        System.out.println(source.getProperty("OS"));
    }
}
